package chapter6;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * 创建arr1,arr2,将arr1的0-3个元素复制到arr2中，并输出
 */
public class Test6_7_1 {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3,4,5,6};
        int[] arr2;
        arr2 = Arrays.copyOfRange(arr1,0,3);
        System.out.println("arr1 : ");
        for(int i : arr1){
            System.out.print(i + " ");
        }
        System.out.println("\narr2 : ");
        for(int i : arr2){
            System.out.print(i + " ");
        }
    }
}
